package com.hotelvip.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * pojo基类，完成2个任务，2个日期，实现序列化
 * @author Lzh
 * @date 2020/11/27 13:46
 */
@Data
@Accessors(chain=true)
public class BasePojo implements Serializable {
    private static final long serialVersionUID = 1478085197431468297L;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)  //新增有效
    private Date createdTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT_UPDATE)	//新增和更新有效
    private Date updatedTime;

}